Skip to content

Add formatter pyproject regression coverage - #596

Merged
koxudaxi merged 6 commits into
mainfrom
add-black-formatter-regression
May 31, 2026
Merged

koxudaxi merged 6 commits into
mainfrom
add-black-formatter-regression

Conversation

@koxudaxi

@koxudaxi koxudaxi commented May 31, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Documentation

    • Updated supported input formats documentation to reflect additional OpenAPI YAML fixture coverage.
  • Tests

    • Added test coverage for OpenAPI formatter configuration with parent project settings.

@coderabbitai

coderabbitai Bot commented May 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@koxudaxi, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 9 minutes and 11 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c0a8dc13-8e38-45f4-a3eb-93ce6bf61302

📥 Commits

Reviewing files that changed from the base of the PR and between 811ca43 and b35b00f.

📒 Files selected for processing (5)
  • docs/llms-full.txt
  • docs/supported_formats.md
  • fastapi_code_generator/prompt_data.py
  • tests/data/expected/openapi/coverage/request_body_without_schema/main.py
  • tests/main/test_main.py

Walkthrough

This PR adds a new OpenAPI code generation test fixture that validates handling of projects where pyproject.toml resides in a parent directory. It includes the input OpenAPI specification, expected generated Python code, a test case that validates the generation process, and documentation updates reflecting the new fixture.

Changes

OpenAPI formatter_parent_pyproject test fixture

Layer / File(s) Summary
Input fixture - OpenAPI spec and configuration
tests/data/openapi/coverage/formatter_parent_pyproject/api.yaml, tests/data/openapi/coverage/formatter_parent_pyproject/pyproject.toml
OpenAPI 3.0 YAML specification defines a /pets GET endpoint with Pet and Pets schemas; Poetry configuration specifies project metadata.
Expected generated output
tests/data/expected/openapi/coverage/formatter_parent_pyproject/models.py, tests/data/expected/openapi/coverage/formatter_parent_pyproject/main.py
Generated Pet Pydantic model with id and name fields, and FastAPI application with configured metadata and /pets endpoint handler returning List[Pet].
Test validation
tests/main/test_main.py
New test copies fixture files into a temporary project, runs the code generator with timestamp disabled, and validates output matches the expected generated code.
Documentation update
docs/supported_formats.md
OpenAPI YAML fixture count updated from 28 to 29.

🎯 2 (Simple) | ⏱️ ~12 minutes

🐰 A test fixture hops into the garden,
With pets and schemas, we beg your pardon!
The spec, expected, and test align,
One fuzzy checkpoint, a change so fine! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: adding regression coverage for formatter pyproject settings, which is reflected in the new test and fixture files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-black-formatter-regression

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed

codspeed Bot commented May 31, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 1 untouched benchmark


Comparing add-black-formatter-regression (b35b00f) with main (3bf3c02)

Open in CodSpeed

@github-actions

github-actions Bot commented May 31, 2026 •

Copy link
Copy Markdown
Contributor

📚 Docs Preview: https://pr-596.fastapi-code-generator.pages.dev

@codecov

codecov Bot commented May 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (fa1e00e) to head (b35b00f).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #596   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         1375      1404   +29     
  Branches       140       143    +3     
=========================================
+ Hits          1375      1404   +29     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@koxudaxi
koxudaxi marked this pull request as ready for review May 31, 2026 14:56
@koxudaxi
koxudaxi merged commit 6132045 into main May 31, 2026
46 checks passed
@koxudaxi
koxudaxi deleted the add-black-formatter-regression branch May 31, 2026 15:30
@github-actions github-actions Bot added the breaking-change-analyzed PR has been checked for release draft updates label May 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Breaking Change Analysis

Result: No breaking changes detected

Reasoning: PR #596 only adds new test coverage (a regression test for formatter configuration with parent pyproject.toml) and updates documentation fixture counts. No production source code (CLI, parser, config, templates, or code generation logic) was modified. The only non-test change is updating fixture counts in docs. This is purely additive test infrastructure with no impact on users.


This analysis was performed by Claude Code Action

@github-actions

Copy link
Copy Markdown
Contributor

🎉 Released in 0.7.0

This PR is now available in the latest release. See the release notes for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change-analyzed PR has been checked for release draft updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant